package main

import (
	"fmt"
	"github.com/jinzhu/gorm"
	_ "github.com/jinzhu/gorm/dialects/mysql"
	"go_motor_catalog/services"
)

func main() {
	//pdfs := services.NewBmw().GetPdfs()
	//for i := range pdfs {
	//	fmt.Println(pdfs[i])
	//}

	//pdfs := services.NewBmwMotorrad().GetPdfs()
	//for i := range pdfs {
	//	fmt.Println(pdfs[i])
	//}

	//services.NewTriumph().GetDocumentUrls()

	db, err := gorm.Open("mysql", "root:root@tcp(127.0.0.1:3306)/smallboot?charset=utf8&parseTime=True&loc=Local")
	if err != nil {
		fmt.Println("连接数据库失败", err)
		return
	}
	db.SingularTable(true)
	defer db.Close()
	om := services.NewDucatiOm()
	om.CrawData(db)

}
